package org.gangcai.mac.shop.activity;

import android.os.Bundle;
import android.view.View;

import org.gangcai.mac.shop.api.AppAPI;
import org.gangcai.mac.shop.bean.CommonResonseBean;
import org.gangcai.mac.shop.bean.UserDataBean;
import org.gangcai.mac.shop.manager.RetrofitManager;
import org.gangcai.mac.shop.manager.RetrofitManageres;

import io.reactivex.Observable;

public class FindPasswordActivity extends RegisterActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initTitleBarView(titlebar, "忘记密码");
        codeType = "2";
        initView2();
    }

    private void initView2() {
        forgetPasswordsolide.setVisibility(View.GONE);
        registerCode.setVisibility(View.GONE);
        protocoLl.setVisibility(View.GONE);
        newPassword.setHint("请输入新密码");
        newPassword2.setHint("请重复输入新密码");
        btn.setText("确定");
    }

    @Override
    public Observable<UserDataBean> getObserver() {
        Observable<UserDataBean> register = RetrofitManageres.getInstance().create(AppAPI.class)
                .FindPasswordData(iphone.getText().toString(),
                        newPassword2.getText().toString(),
                        code.getText().toString());
        return register;
    }
}
